# -*- coding: utf-8 -*-
# @Time    : 2022/1/11 14:13
# @Author  : 徐翊宸
# @Email   : xyc@163.com
# @File    : page_tjbm.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class TjbmPage(BasePage):


    toux_locator = (By.CSS_SELECTOR, "body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul.nav.pull-right > li:nth-child(6) > a > img")
    zzjg_locator = (By.CSS_SELECTOR, "body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul.nav.pull-right > li.dropdown.open > ul > li:nth-child(4) > a")
    tjbm_submit_locator = (By.LINK_TEXT, "添加部门")
    bumenname_locator = (By.CSS_SELECTOR, "#name")
    bmms_locator = (By.CSS_SELECTOR, "#department_add > div:nth-child(3) > div > textarea")
    queding_locator = (By.CSS_SELECTOR, "body > div:nth-child(9) > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div > button:nth-child(1) > span")

    def __int__(self, driver):
        self.driver = driver

    def toux_click(self):
        self.driver.find_element(*self.toux_locator).click()

    def zzjg_click(self):
        self.driver.find_element(*self.zzjg_locator).click()

    def tjbm_submit_click(self):
        self.driver.find_element(*self.tjbm_submit_locator).click()

    def bumenname_input(self, bumenname):
        self.driver.find_element(*self.bumenname_locator).send_keys(bumenname)

    def bmms_input(self, bmms):
        self.driver.find_element(*self.bmms_locator).send_keys(bmms)

    def queding_click(self):
        self.driver.find_element(*self.queding_locator).click()









